<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="forever.com.vo.*"  %>
<%@ page import="forever.com.pojo.*"  %>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'test.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script src="script/json2.js" type="text/javascript"></script>
	<script src="script/jquery-1.7.2.min.js" type="text/javascript"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  <script type="text/javascript">
function sub(thismessageid)
{

$.ajax({
type:"post", //请求方式
url:"<%=path%>/getATMsLandMarks", //发送请求地址
data:{ //发送给数据库的数据
messageid:thismessageid,
},
//请求成功后的回调函数有两个参数
success:function(data,textStatus){
$("#test2").html(data);
var dataObj=eval("("+data+")");
alert(dataObj[1].name);//输出root的子对象数量 
}
});
}
  function test(){
 	var ss = document.getElementById('test');
 	alert(ss.innerHTML);
  }
  </script>
  <body>
    <a href="<%=path%>/getATMsLandMarks">getList</a><br />
     <textarea id="content" ></textarea>
     <input type="submit" />
     
     <div id="test" style="position"absolute;top:200px;left:400px;"">		
     <%if(request.getAttribute("messageid")!=null) {%>
     	<a href="javascript:void(0);" onclick="sub('${messageid}')" ><c:out value="${messageid}"/></a><br /><input type="button" id="nima"  value="restAjax" />
     	<%}else{ %>
     	wu<%} %>
	</div>
     
     <div id="test2" ></div>
      <a href="/Forever/getAllMessage?userid=2">getList</a><br />
    
     <form id="form1" action="<%=path%>/TestAjaxAjax">
     <textarea id="content" ></textarea>
     <input type="submit" />
     <input type="button" onclick = "test()" />
     <div id="test" style="position"absolute;top:200px;left:400px;"">
     <%
    List<Message> list = (List<Message>)request.getAttribute("list");
    	if(list!=null){
    		%>
    		
    		<c:forEach var="message" items="${list}">
     			&nbsp;<a href="<%=path%>/viewMessageDetail?messageid=${message.messageid}"><c:out value="${message.messagetitle}"/></a>:::::
     			&nbsp;<c:out value="${message.sendername}"/><br>
    		</c:forEach>
    		<%
    	}
     %></div>
     
     <%
     MessageBoxVO message = (MessageBoxVO)request.getAttribute("message");
     if(message!=null){
     %>
    	<%=message.getMessage_content() %>
    	
    	<c:out value="${message.message_content}"></c:out>
      <%} %>
      
      
      <%
      
       %>
     </form>
  </body>
</html>
